package com.example.dao;

import com.example.entity.Comment;
import com.example.entity.CommentLike;
import com.example.entity.vo.CommentVO;

import java.util.List;

/**
 * @Description: 评论持久层接口
 * @Date: 2022/11/15 16:10
 * @Author: SinkDream
 */
public interface CommentDao {
    Comment getComment(Long id);

    //根据文章id和父id查询评论
    List<CommentVO> findByArticleIdParentId(Long articleId, Long parentId);

    //添加评论
    int addComment(Comment comment);

    //查询评论总数
    int countComment(Long articleId);

    //删除评论
    int deleteComment(Long id);

    int updateCommentLikes(Comment comment);

    List<Comment> listCommentByParentId(Long parentId);

    //增加点赞
    int addCommentLike(CommentLike commentLike);

    //取消点赞
    int deleteCommentLike(CommentLike commentLike);

    //查询用户对评论是否点赞
    List<CommentLike> listCommentLike(Long userId);

    CommentLike getCommentLike(Long id);
}
